package compress.nio;

import java.io.FileNotFoundException;
import java.io.RandomAccessFile;
import java.nio.channels.FileChannel;

public class Demo01 {
    public static void main(String[] args) throws Exception {
        RandomAccessFile fromFile = new RandomAccessFile("data/00000000000048493522.timeindex", "rw");
        FileChannel fromChannel = fromFile.getChannel();

        RandomAccessFile toFile = new RandomAccessFile("data/3.txt", "rw");
        FileChannel toChannel = toFile.getChannel();

        long postition =0L;
        long count =  fromChannel.size();
        toChannel.transferFrom(fromChannel,count,postition);

    }
}
